import pandas as pd

df=pd.DataFrame()
key_indexed = df.set_index()
# 正式逻辑
indexed = set(key_indexed.index.get_level_values(0))